package com.wanxi.test;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class HeBing {
    public static void main(String[] args) {
        List<Student> nan = new ArrayList<>();
        nan.add(new Student("郭靖", 22));
        nan.add(new Student("吴亦凡", 22));
        nan.add(new Student("蔡徐坤", 22));

        List<Student> nv = new ArrayList<>();
        nv.add(new Student("黄蓉", 22));
        nv.add(new Student("赵丽颖", 22));
        nv.add(new Student("张靓颖", 22));
        nv.add(new Student("杨亮银", 22));
        nv.add(new Student("杨金银", 22));
        Stream<Student> a = nan.stream().filter(student -> student.getName().length() == 3)
                .limit(2);

        Stream<Student> b = nv.stream().filter(student -> student.getName().startsWith("杨"))
                .skip(1);
        Stream<Student> concat = Stream.concat(a, b);
    }
}
